<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/jquery-1.4.4.min.js"></script>
</head>
<body>

<input type="button" onclick="doGet()" value="get">
<input type="button" onclick="doPost()" value="post">

</body>
<script>
    function doGet() {
        $.ajax({
            url:"/json/findById?id=1",
            type:"get",
            success:function (data) {
                console.log(data);
            },
            error:function (data) {
                console.log(data);
            }
        });
    }

    function doPost() {
        $.ajax({
            url:"/json/add",
            type:"post",
            data:"{\"id\":2,\"name\":\"zzz\",\"sex\":\"男\"}",
            contentType:"application/json",
            success:function (data) {
                console.log(data);
            },
            error:function (data) {
                console.log(data);
            }
        });
    }
</script>
</html>